package com.uchedao.seller.module;

import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;

/**
 * 事故勘察
 * 
 * @author "叶晋"
 * 
 */
public class Accident implements Cloneable {

	@Expose
	@SerializedName("cover")
	// public ResultBoolean[] cover = new ResultBoolean[11];// 覆盖件
	public ResultInt[] cover = new ResultInt[11];// 覆盖件

	@Expose
	@SerializedName("reinforcement")
	// 加强件 检测结果(0未见修复痕迹,1有轻微修复痕迹,2有严重修复痕迹)
	public ResultInt[] reinforcement = new ResultInt[22];

	@Expose
	@SerializedName("skeletonPicUrl")
	public String skeletonPicUrl;// 结构件示意图

	@Expose
	@SerializedName("skeletonPicId")
	public String skeletonPicId;// 结构件示意图

	@Expose
	@SerializedName("skeleton")
	// 结构件 检测结果(0 未见事故痕迹,1 轻微事故痕迹,2 严重事故痕迹)
	public Skeleton[] skeletons = new Skeleton[20];

	public Accident() {
//		for (ResultInt resultInt : cover)
//			resultInt = new ResultInt();
//
//		for (ResultInt resultInt : reinforcement)
//			resultInt = new ResultInt();
//
//		for (Skeleton skeleton : skeletons)
//			skeleton = new Skeleton();
	}

	@Override
	public Accident clone() {
		Accident accident = null;
		try {
			accident = (Accident) super.clone();
			accident.cover = cover.clone();
			for (int i = 0; i < cover.length; i++)
				if (cover[i] != null)
					accident.cover[i] = cover[i].clone();
			accident.reinforcement = reinforcement.clone();
			for (int i = 0; i < reinforcement.length; i++)
				if (reinforcement[i] != null)
					accident.reinforcement[i] = reinforcement[i].clone();
			accident.skeletons = skeletons.clone();
			for (int i = 0; i < skeletons.length; i++)
				if (skeletons[i] != null)
					accident.skeletons[i] = skeletons[i].clone();
		} catch (CloneNotSupportedException e) {
			e.printStackTrace();
		}
		return accident;
	}


//	public void cloneCover(){
//		Accident accident = (Accident) super.clone();
//		accident.cover = cover.clone();
//		for (int i = 0; i < cover.length; i++)
//			if (cover[i] != null)
//				accident.cover[i] = cover[i].clone();
//	}

	// public String toString() {
	// // 覆盖件
	// // String[] coverNames =
	// GlobalInfo.resources.getStringArray(R.array.cover_values);
	// // JsonObject coverJson = new JsonObject();
	// JsonArray coverJson=new JsonArray();
	// for (int i = 0; i < cover.length; i++) {
	// coverJson.
	// }
	//
	// // 加强件
	// String[] reinforcementName =
	// GlobalInfo.resources.getStringArray(R.array.cover_values);
	// JsonObject reinforcementJson = new JsonObject();
	// for (int i = 0; i < reinforcementName.length; i++)
	// reinforcementJson.addProperty(reinforcementName[i], reinforcement[i]);
	//
	// // Skeleton skeleton;
	// JsonArray array = new JsonArray();
	// for (int i = 0; i < skeletons.length; i++) {
	// JsonObject obj = new JsonObject();
	// if (skeletons[i] != null) {
	// obj.addProperty(property, value);
	// }
	// }
	//
	// JsonObject accident = new JsonObject();
	// accident.add("cover", coverJson);
	// accident.add("reinforcement", reinforcementJson);
	//
	// return accident.toString();
	// }

}
